﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HomeMediaBrowser
{
    public partial class LoginForm : Form
    {
        public LoginForm()
        {
            InitializeComponent();
        }

        private void Btn_Save_Click(object sender, EventArgs e)
        {
            int result = GoogleLoginPage.LogIn(GetUserName(), GetPassword());
            if (result <= 0)
            {
                Label_Error.Text = "Error,Invalided Username or password";
                return;
            }
            Btn_Save.DialogResult = DialogResult.OK;
            this.DialogResult = DialogResult.OK;
            this.Dispose();
        }

        private void LoginForm_Load(object sender, EventArgs e)
        {
            this.CenterToScreen();
        }
        public string GetUserName()
        {
            return Input_GoogleMail.Text + "@gmail.com";
        }
        public string GetPassword()
        {
            return Input_Password.Text;
        }
    }
}
